<?php include '../../authorization_check.php' ?>
<?php include '../../checkSecretaryOnly.php' ?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9">
<title>View Defined Courses</title>
<SCRIPT TYPE="text/javascript" src= "../../commonutils/util/util.js"> </SCRIPT>

</head>
<style type="text/css">
/* th {text-align: right} */
</style>
<body>

<?php include 'top.html' ?>

<?php include 'notifier.php' ?>

<p>
<table border=1 cellpadding=3>
<tr>
<th>COURSE CODE</th>
<th>COURSE NAME</th>
<th>SECTION NUMBER</th>
<th>EXAM TYPE</th>
<th>EXAM DATE </th>
<th>START TIME </th>
<th>END TIME </th>
<th>ROOM</th>
</tr>
<?php
require_once '../../commonutils/db/DBConnectionManager.php';

	$sqlquery = " select c.courseCode, c.courseName, s.sectionNumber, e.examType, e.examDate, e.startTime, e.endTime, e.roomCode ".
				" from exam e, section s, course c ".
				" where s.sectionID = e.sectionID and c.courseCode = s.courseCode ".
				" and c.programCode = ". $programCode." and e.semesterID = ".$semesterID ;
	 
	//echo $sqlquery."<br>"; 

	$result = DBConnectionManager::query($sqlquery);
	while($row = mysql_fetch_assoc($result)){
		if($row['examType'] == 1)
		   $eType = 'Midterm';
		else
		   $eType = 'Final';
		   
		echo "<tr>";
		echo "<td>".$row['courseCode']." &nbsp;</td>";
		echo "<td>".$row['courseName']." &nbsp;</td>";
		echo "<td>".$row['sectionNumber']."     &nbsp;</td>";
		echo "<td>".$eType."&nbsp;</td>";
		echo "<td>".$row['examDate']." &nbsp;</td>";		
		echo "<td>".$row['startTime']." &nbsp;</td>";
		echo "<td>".$row['endTime']." &nbsp;</td>";
		echo "<td>".$row['roomCode']."     &nbsp;</td>";		
		echo "</tr>";		
	}

?>

</table>
</p>  

<?php include 'bottom.php' ?>

</body>


</html>